<!--头部公共部分-->
{include file="common/header" /}
<div style="padding:15px;">

    <script>
            var contract_id = '{$contract_id}';
            var contract_number_name = '{$contract_number_name}';
            var contract_id_arr = contract_id.split(",");
            var contract_number_name_arr = contract_number_name.split(",");
            console.log(contract_id_arr)
            for(var a = 0; a < contract_id_arr.length; a ++){
                document.write('<div class="layui-form-item" style="text-align: center">');
                document.write('<button  class="layui-btn layui-btn-normal"  style="width: 200px;" onclick="classForm_contract(this)" ><input type="hidden" name="contract_id" value="'+contract_id_arr[a]+'">'+contract_number_name_arr[a]+'</button>');
                document.write('<div class="layui-form-item" style="text-align: center">');
                document.write('<br>');

            }
        </script>

</div>
<!--底部公共部分-->
{include file="common/footer" /}


<script>



    function classForm_contract(obj)
    {
        var contract_id = $(obj).find("input[name='contract_id']").val();
        var contract_name = "";
        for(var a = 0; a < contract_id_arr.length; a ++){
            if(contract_id_arr[a] == contract_id){
                contract_name = contract_number_name_arr[a];
                break;
            }
        }
        parent.setContract_infos(contract_id,contract_name); //这是父页面函数
        let index = parent.layer.getFrameIndex(window.name);
        parent.layer.close(index);
    }



    layui.use(['table', 'jquery', 'form', 'layer', 'element', 'laydate'], function () {
        let $ = layui.jquery
            , layer = layui.layer
            , table = layui.table
            , element = layui.element
            , laydate = layui.laydate
            , form = layui.form;



    });

</script>